package com.zhonghui.mapper;

import com.zhonghui.annotation.AutoFill;
import com.zhonghui.dto.AddressCreateDto;
import com.zhonghui.enumeration.OperationType;
import com.zhonghui.model.Address;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author: FL
 * @create: 2024 2024/5/5 18:44
 */
@Mapper
public interface AddressMapper {
    Address getAddressByAddressId(Long userId,Long addressId);
    List<Address> getAllAddress(Long userId);

    @AutoFill(value = OperationType.INSERT)
    Integer createAddress(Address address);

    @AutoFill(value = OperationType.UPDATE)
    Integer updateAddress(AddressCreateDto addressCreateDto, Long id);

    Integer deleteAddress(Long id);
}
